<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');

$user = JFactory::getUser();
?>

<?php foreach($this->items as $i => $item): ?>
<?php
//		$ordering	= ($listOrder == 'ordering');
		$canCreate	= $user->authorise('core.create',		'com_ngmenu');
		$canEdit	= $user->authorise('core.edit',			'com_ngmenu');
		$canCheckin	= $user->authorise('core.manage',		'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
//		$canChange	= $user->authorise('core.edit.state',	'com_ngmenu') && $canCheckin;
		$canChange = true;
?>

	<tr class="row<?php echo $i % 2; ?>">
		<td>
			<?php echo JHtml::_('grid.id', $i, $item->id); ?>
		</td>
		<td>
			<a href="<?php echo JRoute::_('index.php?option=com_ngmenu&task=ngmenu.edit&id='.(int) $item->id); ?>">
			<?php echo $this->escape($this->titles[$item->id]); ?></a>
		</td>
		<td>
			<?php echo ($item->template=='0') ? JText::_('COM_NGMENU_LIST_VALUES_INDEPENDENT') : $item->template; ?>
		</td>
		<td>
			<?php echo ($item->is_horizontal) ? JText::_('COM_NGMENU_LIST_VALUES_HORIZONTAL') : JText::_('COM_NGMENU_LIST_VALUES_VERTICAL'); ?>
		</td>
		<td>
			<?php echo ($item->absolute_position) ? JText::_('COM_NGMENU_LIST_VALUES_ABSOLUTE') : JText::_('COM_NGMENU_LIST_VALUES_RELATIVE'); ?>
		</td>
		<td>
			<a href="<?php echo JRoute::_('index.php?option=com_modules&task=module.edit&id='.(int) $this->modules[$item->id]->id); ?>">
					<?php echo JText::_('COM_NGMENU_MODULE'); ?></a>
		</td>
		<td class="center">
			<?php //echo JHtml::_('jgrid.published', $this->modules[$item->id]->published, $i, 'ngmenus.'.$this->modules[$item->id]->id.'.', true, 'cb'); ?>
			<?php echo JHtml::_('jgrid.published', $this->modules[$item->id]->published, $i, 'ngmenus.', $canChange, 'cb'); ?>
		</td>
		<td>
			<?php echo $this->escape($this->modules[$item->id]->access_level); ?>
		</td>
		<td>
			<?php echo $this->modules[$item->id]->position; ?>
		</td>
	</tr>
	
<?php endforeach; ?>
